package org.cw.service.imp;

import org.apache.log4j.Logger;
import org.cw.dao.ExampleDao;
import org.cw.exception.ServiceException;
import org.cw.pojo.Example;
import org.cw.service.ExampleService;
import org.cw.vo.ExampleVo;

public class ExampleServiceImp implements ExampleService
{
	private Logger log = Logger.getLogger(ExampleServiceImp.class);
	private ExampleDao exampleDao;
	
	public ExampleDao getExampleDao() {
		return exampleDao;
	}

	public void setExampleDao(ExampleDao exampleDao) {
		this.exampleDao = exampleDao;
	}

	public void insert(ExampleVo vo) throws ServiceException
	{
		try{
			log.info("ExampleService: " + vo.getName());
			Example example = new Example();
			example.setName(vo.getName());
			exampleDao.insert(example);
		}catch(Exception e)
		{
			throw new ServiceException("the operatation is faild!");
		}
	}

	@Override
	public ExampleVo queryByName(String queryByName) throws ServiceException {
		// TODO Auto-generated method stub
		return null;
	}
}
